#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
//https://www.luogu.com.cn/problem/P2969
using namespace std;
const int N = 5e4 + 10;
int n, b, q;
int a[N];
int main()
{
	cin >> n >> q;
	int cnt = 0;
	for (int i = 1; i <= n; ++i)
	{
		cin >> b;
		while (b--)
		{
			a[cnt++] = i;
		}
	}


	while (q--)
	{
		int t;
		cin >> t;
		cout << "-----------" << a[t] << endl;
	}


	return 0;
}